package com.dap.commons;

/**
 * Created by wangmin on 2019/4/25.
 */
public enum PlatformEnum {
    ios("1"),
    android("2"),
    pc("3"),
    wechat("4");

    protected String value;
    PlatformEnum(String value) {
        this.value = value;
    }


    public String getValue() {
        return value;
    }

    public static PlatformEnum parseByValue(String value) {
        if (null == value || value.isEmpty())
            return null;

        PlatformEnum[] list = PlatformEnum.values();
        for (int i = 0; i < list.length; ++i) {
            if (list[i].value.equals(value))
                return list[i];
        }

        return null;
    }
}
